<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Object</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Object</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/vendor/rails/railties/lib/rails_generator/lookup_rb.html">
                vendor/rails/railties/lib/rails_generator/lookup.rb
                </a>
        <br />
                <a href="../files/vendor/rails/actionpack/lib/action_controller/routing_rb.html">
                vendor/rails/actionpack/lib/action_controller/routing.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/blank_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/blank.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/duplicable_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/object/extending_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/core_ext/object/misc_rb.html">
                vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/dependencies_rb.html">
                vendor/rails/activesupport/lib/active_support/dependencies.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/json/encoders/object_rb.html">
                vendor/rails/activesupport/lib/active_support/json/encoders/object.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/vendor/builder-2_1_2/blankslate_rb.html">
                vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Same as above, except in <a href="Object.html">Object</a>.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000141">acts_like?</a>&nbsp;&nbsp;
      <a href="#M000133">blank?</a>&nbsp;&nbsp;
      <a href="#M000134">duplicable?</a>&nbsp;&nbsp;
      <a href="#M000145">find_hidden_method</a>&nbsp;&nbsp;
      <a href="#M000137">instance_exec</a>&nbsp;&nbsp;
      <a href="#M000138">instance_variable_defined?</a>&nbsp;&nbsp;
      <a href="#M000131">lookup_missing_generator</a>&nbsp;&nbsp;
      <a href="#M000144">method_added</a>&nbsp;&nbsp;
      <a href="#M000139">returning</a>&nbsp;&nbsp;
      <a href="#M000143">to_json</a>&nbsp;&nbsp;
      <a href="#M000135">to_param</a>&nbsp;&nbsp;
      <a href="#M000132">to_param</a>&nbsp;&nbsp;
      <a href="#M000136">to_query</a>&nbsp;&nbsp;
      <a href="#M000142">unloadable</a>&nbsp;&nbsp;
      <a href="#M000140">with_options</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">InstanceExecMethods</span>
      </div>
    </div>

    <div id="section">



    <div id="aliases-list">
      <h3 class="section-bar">External Aliases</h3>

      <div class="name-list">
                        <table summary="aliases">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">send</td>
          <td>-&gt;</td>
          <td class="context-item-value">send!</td>
        </tr>
      <tr class="top-aligned-row context-row">
        <td>&nbsp;</td>
        <td colspan="2" class="context-item-desc">
Anticipating Ruby 1.9 neutering send

</td>
      </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">load</td>
          <td>-&gt;</td>
          <td class="context-item-value">load_without_new_constant_marking</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">method_added</td>
          <td>-&gt;</td>
          <td class="context-item-value">blank_slate_method_added</td>
        </tr>
                        </table>
      </div>
    </div>


      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000145" class="method-detail">
        <a name="M000145"></a>

        <div class="method-heading">
          <a href="#M000145" class="method-signature">
          <span class="method-name">find_hidden_method</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000145-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb, line 90</span>
90:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_hidden_method</span>(<span class="ruby-identifier">name</span>)
91:       <span class="ruby-keyword kw">nil</span>
92:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000131" class="method-detail">
        <a name="M000131"></a>

        <div class="method-heading">
          <a href="#M000131" class="method-signature">
          <span class="method-name">lookup_missing_generator</span><span class="method-args">(class_id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Lookup missing generators using const_missing. This allows any generator to
reference another without having to know its location: RubyGems,
~/.rails/generators, and RAILS_ROOT/generators.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000131-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/lookup.rb, line 8</span>
 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup_missing_generator</span>(<span class="ruby-identifier">class_id</span>)
 9:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">md</span> = <span class="ruby-regexp re">/(.+)Generator$/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">class_id</span>.<span class="ruby-identifier">to_s</span>)
10:         <span class="ruby-identifier">name</span> = <span class="ruby-identifier">md</span>.<span class="ruby-identifier">captures</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">demodulize</span>.<span class="ruby-identifier">underscore</span>
11:         <span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">Generator</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">klass</span>
12:       <span class="ruby-keyword kw">else</span>
13:         <span class="ruby-identifier">const_missing_before_generators</span>(<span class="ruby-identifier">class_id</span>)
14:       <span class="ruby-keyword kw">end</span>
15:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000144" class="method-detail">
        <a name="M000144"></a>

        <div class="method-heading">
          <a href="#M000144" class="method-signature">
          <span class="method-name">method_added</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Detect method additions to <a href="Object.html">Object</a> and remove them
in the <a href="BlankSlate.html">BlankSlate</a> class.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000144-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb, line 83</span>
83:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_added</span>(<span class="ruby-identifier">name</span>)
84:       <span class="ruby-identifier">result</span> = <span class="ruby-identifier">blank_slate_method_added</span>(<span class="ruby-identifier">name</span>)
85:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Object</span>
86:       <span class="ruby-constant">BlankSlate</span>.<span class="ruby-identifier">hide</span>(<span class="ruby-identifier">name</span>)
87:       <span class="ruby-identifier">result</span>
88:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000141" class="method-detail">
        <a name="M000141"></a>

        <div class="method-heading">
          <a href="#M000141" class="method-signature">
          <span class="method-name">acts_like?</span><span class="method-args">(duck)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A duck-type assistant method. For example, ActiveSupport extends Date to
define an acts_like_date? method, and extends Time to define
acts_like_time?. As a result, we can do &quot;x.acts_like?(:time)&quot; and
&quot;x.acts_like?(:date)&quot; to do duck-type-safe comparisons, since
classes that we want to act like Time simply need to define an
acts_like_time? method.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000141-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb, line 56</span>
56:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">acts_like?</span>(<span class="ruby-identifier">duck</span>)
57:     <span class="ruby-identifier">respond_to?</span> <span class="ruby-node">&quot;acts_like_#{duck}?&quot;</span>
58:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000133" class="method-detail">
        <a name="M000133"></a>

        <div class="method-heading">
          <a href="#M000133" class="method-signature">
          <span class="method-name">blank?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
An object is blank if it&#8216;s nil, empty, or a whitespace string. For
example, &quot;&quot;, &quot; &quot;, nil, [], and {} are blank.
</p>
<p>
This simplifies
</p>
<pre>
  if !address.nil? &amp;&amp; !address.empty?
</pre>
<p>
to
</p>
<pre>
  if !address.blank?
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000133-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/blank.rb, line 9</span>
 9:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blank?</span>
10:     <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:empty?</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">empty?</span> <span class="ruby-operator">:</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>
11:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000134" class="method-detail">
        <a name="M000134"></a>

        <div class="method-heading">
          <a href="#M000134" class="method-signature">
          <span class="method-name">duplicable?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Can you safely .dup this object? False for nil, false, true, symbols, and
numbers; true otherwise.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000134-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb, line 4</span>
4:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">duplicable?</span>
5:     <span class="ruby-keyword kw">true</span>
6:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000137" class="method-detail">
        <a name="M000137"></a>

        <div class="method-heading">
          <a href="#M000137" class="method-signature">
          <span class="method-name">instance_exec</span><span class="method-args">(*args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Evaluate the block with the given arguments within the context of this
object, so self is set to the method receiver.
</p>
<p>
From Mauricio&#8216;s <a
href="http://eigenclass.org/hiki/bounded+space+instance_exec">eigenclass.org/hiki/bounded+space+instance_exec</a>
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000137-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb, line 41</span>
41:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
42:       <span class="ruby-keyword kw">begin</span>
43:         <span class="ruby-identifier">old_critical</span>, <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">critical</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">critical</span>, <span class="ruby-keyword kw">true</span>
44:         <span class="ruby-identifier">n</span> = <span class="ruby-value">0</span>
45:         <span class="ruby-identifier">n</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;__instance_exec#{n}&quot;</span>)
46:         <span class="ruby-constant">InstanceExecMethods</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">define_method</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }
47:       <span class="ruby-keyword kw">ensure</span>
48:         <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">critical</span> = <span class="ruby-identifier">old_critical</span>
49:       <span class="ruby-keyword kw">end</span>
50: 
51:       <span class="ruby-keyword kw">begin</span>
52:         <span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
53:       <span class="ruby-keyword kw">ensure</span>
54:         <span class="ruby-constant">InstanceExecMethods</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">remove_method</span>(<span class="ruby-identifier">method_name</span>) } <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
55:       <span class="ruby-keyword kw">end</span>
56:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000138" class="method-detail">
        <a name="M000138"></a>

        <div class="method-heading">
          <a href="#M000138" class="method-signature">
          <span class="method-name">instance_variable_defined?</span><span class="method-args">(variable)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000138-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb, line 4</span>
4:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_variable_defined?</span>(<span class="ruby-identifier">variable</span>)
5:       <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">variable</span>.<span class="ruby-identifier">to_s</span>)
6:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000139" class="method-detail">
        <a name="M000139"></a>

        <div class="method-heading">
          <a href="#M000139" class="method-signature">
          <span class="method-name">returning</span><span class="method-args">(value) {|value| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A Ruby-ized realization of the K combinator, courtesy of Mikael Brockman.
</p>
<pre>
  def foo
    returning values = [] do
      values &lt;&lt; 'bar'
      values &lt;&lt; 'baz'
    end
  end

  foo # =&gt; ['bar', 'baz']

  def foo
    returning [] do |values|
      values &lt;&lt; 'bar'
      values &lt;&lt; 'baz'
    end
  end

  foo # =&gt; ['bar', 'baz']
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000139-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb, line 27</span>
27:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">returning</span>(<span class="ruby-identifier">value</span>)
28:     <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">value</span>)
29:     <span class="ruby-identifier">value</span>
30:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000143" class="method-detail">
        <a name="M000143"></a>

        <div class="method-heading">
          <a href="#M000143" class="method-signature">
          <span class="method-name">to_json</span><span class="method-args">(options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Dumps object in JSON (JavaScript <a href="Object.html">Object</a>
Notation). See <a href="http://www.json.org">www.json.org</a> for more
info.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000143-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/json/encoders/object.rb, line 3</span>
3:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_json</span>(<span class="ruby-identifier">options</span> = {})
4:     <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">JSON</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-identifier">instance_values</span>, <span class="ruby-identifier">options</span>)
5:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000135" class="method-detail">
        <a name="M000135"></a>

        <div class="method-heading">
          <a href="#M000135" class="method-signature">
          <span class="method-name">to_param</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Alias of <tt>to_s</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000135-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb, line 3</span>
3:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_param</span>
4:     <span class="ruby-identifier">to_s</span>
5:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000132" class="method-detail">
        <a name="M000132"></a>

        <div class="method-heading">
          <a href="#M000132" class="method-signature">
          <span class="method-name">to_param</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000132-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/routing.rb, line 7</span>
7:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_param</span>
8:     <span class="ruby-identifier">to_s</span>
9:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000136" class="method-detail">
        <a name="M000136"></a>

        <div class="method-heading">
          <a href="#M000136" class="method-signature">
          <span class="method-name">to_query</span><span class="method-args">(key)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Converts an object into a string suitable for use as a URL query string,
using the given <tt>key</tt> as the param name.
</p>
<p>
Note: This method is defined as a default implementation for all Objects
for Hash#to_query to work.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000136-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb, line 11</span>
11:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_query</span>(<span class="ruby-identifier">key</span>)
12:     <span class="ruby-node">&quot;#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}&quot;</span>
13:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000142" class="method-detail">
        <a name="M000142"></a>

        <div class="method-heading">
          <a href="#M000142" class="method-signature">
          <span class="method-name">unloadable</span><span class="method-args">(const_desc)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Mark the given constant as <a href="Object.html#M000142">unloadable</a>.
Unloadable constants are removed each time dependencies are cleared.
</p>
<p>
Note that marking a constant for unloading need only be done once. Setup or
init scripts may list each <a href="Object.html#M000142">unloadable</a>
constant that may need unloading; each constant will be removed for every
subsequent clear, as opposed to for the first clear.
</p>
<p>
The provided constant descriptor may be a (non-anonymous) module or class,
or a qualified constant name as a string or symbol.
</p>
<p>
Returns true if the constant was not previously marked for unloading, false
otherwise.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000142-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/dependencies.rb, line 515</span>
515:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unloadable</span>(<span class="ruby-identifier">const_desc</span>)
516:     <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">mark_for_unload</span> <span class="ruby-identifier">const_desc</span>
517:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000140" class="method-detail">
        <a name="M000140"></a>

        <div class="method-heading">
          <a href="#M000140" class="method-signature">
          <span class="method-name">with_options</span><span class="method-args">(options) {|ActiveSupport::OptionMerger.new(self, options)| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
An elegant way to refactor out common options
</p>
<pre>
  with_options :order =&gt; 'created_at', :class_name =&gt; 'Comment' do |post|
    post.has_many :comments, :conditions =&gt; ['approved = ?', true], :dependent =&gt; :delete_all
    post.has_many :unapproved_comments, :conditions =&gt; ['approved = ?', false]
    post.has_many :all_comments
  end
</pre>
<p>
Can also be used with an explicit receiver:
</p>
<pre>
  map.with_options :controller =&gt; &quot;people&quot; do |people|
    people.connect &quot;/people&quot;,     :action =&gt; &quot;index&quot;
    people.connect &quot;/people/:id&quot;, :action =&gt; &quot;show&quot;
  end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000140-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb, line 47</span>
47:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_options</span>(<span class="ruby-identifier">options</span>)
48:     <span class="ruby-keyword kw">yield</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">OptionMerger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">options</span>)
49:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>